const mongoose = require("mongoose");

const menuSchema = mongoose.Schema({
    menuType: Number,
    menuName: String,//菜单名称
    menuCode: String,//菜单标识符，只有按钮类型才有，用于确定按钮权限
    path: String,//菜单路由
    icon: String,//菜单图标
    component: String,//组件地址
    menuState: Number,//菜单名称
    parentId: {
        type: [mongoose.Types.ObjectId],
        default:[null]
    },
    "createTime": {
        type: Date,
        default: Date.now()
    },
    "updateTime": {
        type: Date,
        default: Date.now()
    },
})

module.exports = mongoose.model("menu", menuSchema, "menus");